@extends('admin.layout.common')
@section('content')
    <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_809874_lzrjua7w53k.css">
    <link rel="stylesheet" type="text/css" href="{{URL::asset('css/music/ReviewWarehousing.css')}}">
    <div class="content">
        <div class="mon">
            <div class="mon_left">
                <p>
                    <i class="iconfont icon gongzuo">&#xe647;</i>
                    <span>{{date('Y年m月d日')}}  本月已开户{{ session('monthPass') }}个  打回{{session('monthRefuse')}}个</span>
                <p>超过了{{ session('monthPrecent') }}的三咖审核员，继续努力！从此踏上人生巅峰，迎娶白富美！</p>
                </p>
            </div>
            <div class="mon_right">
                <p>您今天已经开户{{session('todayPass')}}个    打回{{session('todayRefuse')}}个</p>
                <p>超过了{{session('todayPrecent')}}的三咖开户员哦~棒棒哒！！！</p>
            </div>
        </div>
        <p class="tongzhi"><i class="iconfont icon laba">&#xe914;</i>{{getArticleByDepartmentId()}}</p>
        <!-- 公共结束 -->
        <div class="heade women">
            <h1 class="h1">音乐审核入库</h1>

            <div class="input_box">
                <form method="post" action="{{url('admin/searchMusic')}}" id="searchform">
                <label for="">专辑名：<input type="text" placeholder="请输入" name="album" style="width:130px"></label>
                <label for="">作品名：<input type="text" placeholder="请输入" name="title" style="width:130px"></label>
                <label for="">表演者：
                    <input type="text" placeholder="请输入" name="performer" style="width:130px">
                    <input type="hidden" placeholder="请输入" name="type" required value="1">
                </label>
                <button type="button" value="" onclick=search()>搜索</button>
                </form>
            </div>

            <div class="p_box">
                <p>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-wenjianjia"></use>
                    </svg>
                    <span>当前待审核</span>
                    <span class="cored">{{$statistics[0]}}</span>
                    <span>首</span>
                </p>
                <p>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bijiben"></use>
                    </svg>
                    <span>今日已审核</span>
                    <span class="cored">{{$statistics[1]}}</span>
                    <span>首</span>
                </p>
                <p>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-qianbi"></use>
                    </svg>
                    <span>我已审核</span>
                    <span class="cored">{{$statistics[2]}}</span>
                    <span>首</span>
                </p>
            </div>
        </div>
        <!--/*中间内容开始*/-->
        <div class="center">
            <div class="center_left">
                <h3>音乐审核</h3>
                <div class="Flex">
                    <ul>
                        <li><span>基本信息</span></li>
                        <li><span>歌词信息</span></li>
                        <li><span>伴奏</span></li>
                        <li><span style="padding:84px 30px;">歌曲评价</span></li>
                        <li><span>审核结果</span></li>
                    </ul>
                    <section>
                        <div>
                            <div class="dl_box">
                                <dl>
                                    <input type="hidden" class="id"/>
                                    <dd>作品名：<span class="detail1"></span><i class="iconfont biaozhu title" onclick=signDetail('title')></i><i class="iconfont iconf" onclick=updateDetail('title')>&#x545;</i></dd>
                                    <dd>表演者：<span class="detail2"></span><i class="iconfont biaozhu performer" onclick=signDetail('performer')></i><i class="iconfont iconf" onclick=updateDetail('performer')>&#x545;</i></dd>
                                    <dd>词作者：<span class="detail3"></span><i class="iconfont biaozhu writer" onclick=signDetail('writer')></i><i class="iconfont iconf" onclick=updateDetail('writer')>&#x545;</i></dd>
                                    <dd>曲作者：<span class="detail4"></span><i class="iconfont biaozhu composer" onclick=signDetail('composer')></i><i class="iconfont iconf" onclick=updateDetail('composer')>&#x545;</i></dd>
                                </dl>
                                <dl>
                                    <dd>专辑名：<span class="detail5"></span><i class="iconfont biaozhu album" onclick=signDetail('album')></i><i class="iconfont iconf" onclick=updateDetail('album')>&#x545;</i></dd>
                                    <dd>表演权：<span class="detail6"></span><i class="iconfont biaozhu neighboring_right_1" onclick=signDetail('neighboring_right_1')></i><i class="iconfont iconf" onclick=updateDetail('neighboring_right_1')>&#x545;</i></dd>
                                    <dd>词作权：<span class="detail7" ></span><i class="iconfont biaozhu neighboring_right_2" onclick=signDetail('neighboring_right_2')></i><i class="iconfont iconf" onclick=updateDetail('neighboring_right_2')>&#x545;</i></dd>
                                    <dd>曲作权：<span class="detail8"></span><i class="iconfont biaozhu neighboring_right_3" onclick=signDetail('neighboring_right_3')></i><i class="iconfont iconf" onclick=updateDetail('neighboring_right_3')>&#x545;</i></dd>
                                </dl>
                                <p>
                                    <span>图片信息</span>
                                </p>
                                <dl>
                                    <dt><img class="detail9" src=""></dt>
                                    <dl>
                                        <dd>图片性质：<span class="detail10"></span></dd>
                                        <dd>图片格式：<span class="detail11"></span></dd>
                                        <dd>尺寸：<span class="detail12"></span></dd>
                                        <dd>分辨率：<span class="detail13"></span></dd>
                                        <dd>操作：<i class="iconfont biaozhu image" onclick=signDetail('image')></i><i class="iconfont iconf fangda" onclick=bigLay('cover')>&#xe64c;</i></dd>
                                        {{--<i class="iconfont iconf">&#x545;</i>--}}
                                    </dl>
                                </dl>
                            </div>
                        </div>
                        <div class="music">
                            <div class="scroll_box">
                                <div class="scroll">
                                    <span class="detail14"></span>
                                </div>
                                <p class="p1">
                                    <span>
                                        <i class="iconfont iconf gai" onclick=bigLay('lyrics')>&#xe64c;</i>
                                        <i class="iconfont iconf gai" onclick=updateDetail('lyrics')>&#x545;</i>
                                        <i class="iconfont biaozhu quanquan gai lyrics" onclick=signDetail('lyrics')></i>
                                    </span>
                                </p>
                            </div>
                            <p class="p1">
                                <span>作品<br/>/<br/>专辑简介</span>
                            </p>
                            <div class="jinlichao">
                                <div class="lyric">
                                    <span class="detail15"></span>
                                </div>
                                <p class="p1">
                                    <span>
                                        <i class="iconfont gai" onclick=bigLay('description')>&#xe64c;</i>
                                        <i class="iconfont gai" onclick=updateDetail('description')>&#x545;</i>
                                        <i class="iconfont biaozhu gai description" onclick=signDetail('description')></i>
                                    </span>
                                </p>
                            </div>
                            <p class="Video p1">
                                <span>音频</span>
                            </p>
                            <div class="Radio">
                                <video width="186" height="120" controls id="detail16">
                                    <source src=""  type="video/mp4">
                                    您的浏览器不支持该功能。
                                </video>
                                <p class="p1 p2">
                                    <span>
                                        <i class="iconfont biaozhu gai music_file" onclick=signDetail('music_file')></i>
                                    </span>
                                </p>
                            </div>
                        </div>
                        <div class="accompany">
                            <div class="yinpin">
                                <video width="186" height="120" controls id="detail17">
                                    <source src=""  type="video/mp4">
                                    您的浏览器不支持该功能。
                                </video>
                                </audio>
                                <p class="p2">
                                    <span>
                                        <i class="iconfont biaozhu gai accompaniment" onclick=signDetail('accompaniment')></i>
                                    </span>
                                </p>
                            </div>
                            <div class="Radio">
                                <p class="p1">
                                    <span>
                                        短音频
                                    </span>
                                </p>
                                <video width="186" height="120" controls id="detail18">
                                    <source src=""  type="video/mp4">
                                    您的浏览器不支持该功能。
                                </video>
                                <p class="p2">
                                    <span>
                                        <i class="iconfont biaozhu gai video" onclick=signDetail('video')></i>
                                    </span>
                                </p>
                            </div>
                            <div class="MV">
                                <p class="p1">
                                    <span>
                                        MV
                                    </span>
                                </p>
                                {{--<video width="186" height="120" controls>--}}
                                    {{--<source class="detail19" src=""  type="video/mp4">--}}
                                    {{--您的浏览器不支持该功能。--}}
                                {{--</video>--}}
                                <video width="186" height="120" controls id="detail19">
                                    <source src=""  type="video/mp4">
                                    您的浏览器不支持该功能。
                                </video>
                                <p class="p2">
                                    <span>
                                        <i class="iconfont biaozhu gai mv" onclick=signDetail('mv')></i>
                                    </span>
                                </p>
                            </div>
                            <div class="kalaOK">
                                <p class="p1">
                                    <span>
                                        卡拉OK
                                    </span>
                                </p>
                                <video width="186" height="120" controls id="detail20">
                                    <source src=""  type="video/mp4">
                                    您的浏览器不支持该功能。
                                </video>
                                <p class="p2">
                                    <span>
                                        <i class="iconfont biaozhu gai karaoke" onclick=signDetail('karaoke')></i>
                                    </span>
                                </p>
                            </div>
                        </div>
                        <div class="audit">
                            {{--<div class=wenzi>--}}
                                {{--<p>--}}
                                    {{--<span>审核结果</span>--}}
                                {{--</p>--}}
                            {{--</div>--}}
                            <div style="width:100%;">
                                <form method="post" action="{{url('admin/checkMusic')}}" id="passMusic">
                                    {{csrf_field()}}
                                    <input type="hidden" name="id"/>
                                    <input type="hidden" name="music_file_uuid"/>
                                    <input type="hidden" name="accompaniment_file_uuid"/>
                                    <input type="hidden" name="mv_file_uuid"/>
                                    <input type="hidden" name="video_file_uuid"/>
                                    <input type="hidden" name="karaoke_file_uuid"/>
                                    <div class="audit_left">
                                        <p>
                                            <label for="">作品评级：</label>

                                            <label for=""><input type="radio" id="work1" name="work_rate" value="1" required>A类</label>

                                            <label for=""><input type="radio" name="work_rate" value="2" required>B类</label>

                                            <label for=""><input type="radio" name="work_rate" value="3" required>舞曲</label>
                                        </p>
                                        <p>
                                            <label for="">风&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格：</label>

                                            <label for=""> <input type="radio" name="style" value="1" required>流行</label>

                                            <label for=""><input type="radio" name="style" value="2" required>电子</label>

                                            <label for=""><input type="radio" name="style" value="3" required>舞曲</label>

                                            <label for=""><input type="radio" name="style" value="4" required>摇滚</label>

                                            <label for=""><input type="radio" name="style" value="5" required>爵士</label>

                                            <label for=""><input type="radio" name="style" value="6" required>古典</label>
                                        </p>
                                        <p>
                                            <label for="">歌手类型：</label>

                                            <label for=""><input type="radio" name="singer_type" value="1" required>男歌手</label>

                                            <label for=""><input type="radio" name="singer_type" value="2" required>女歌手</label>

                                            <label for=""><input type="radio" name="singer_type" value="3" required>组合</label>

                                            <label for=""><input type="radio" name="singer_type" value="4" required>乐队</label>
                                        </p>
                                        <p>
                                            <label for="">语&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;种：</label>

                                            <label for=""><input type="radio" name="language" value="1" required>中文</label>

                                            <label for=""><input type="radio" name="language" value="2" required>英文</label>

                                            <label for=""><input type="radio" name="language" value="3" required>日文</label>

                                            <label for=""><input type="radio" name="language" value="4" required>韩语</label>

                                            <label for=""> <input type="radio" name="language" value="5" required>少数民族</label>

                                            <label for=""><input type="radio" name="language" value="6" required>纯音乐</label>

                                            <label for=""><input type="radio" name="language" value="7" required>伴奏</label>

                                            <label for=""><input type="radio" name="language" value="8" required>其他</label>
                                        </p>
                                        <p>
                                            <label for="">是否推荐：</label>

                                            <label for=""><input type="checkbox" name="is_commond" value="2" style="margin:0 5px;transform: translateY(10%)">我要推荐</label>
                                        </p>
                                        <p style="text-align: center;">
                                            <label for=""><input type="checkbox" name="check" value="1" style="margin:0 5px;transform: translateY(10%)" required>我承诺，我已经认真检查</label>
                                        </p>
                                    </div>
                                    <div class="audit_right">
                                        <p>
                                            <label for="">作品库别：</label>

                                            <label for=""><input type="radio" name="library" value="1" required>常规库</label>

                                            <label for=""><input type="radio" name="library" value="2" required>保护库</label>

                                            <label for=""><input type="radio" name="library" value="3" required>自有库</label>

                                            <label for=""><input type="radio" name="library" value="4" required>买断库</label>
                                        </p>
                                        <p>
                                            <label for="">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区：</label>

                                            <label for=""><input type="radio" name="area" value="1" required>大陆</label>

                                            <label for=""><input type="radio" name="area" value="2" required>港台</label>

                                            <label for=""><input type="radio" name="area" value="3" required>海外</label>

                                            <label for=""><input type="radio" name="area" value="4" required>全球</label>
                                        </p>
                                        <p>
                                            <label for="">速&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;度：</label>

                                            <label for=""><input type="radio" name="speed" value="1" required>快</label>

                                            <label for=""><input type="radio" name="speed" value="2" required>中</label>

                                            <label for=""><input type="radio" name="speed" value="3" required>慢</label>
                                        </p>
                                        <p>
                                            <label for="">情&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;绪：</label>

                                            <label for=""><input type="radio" name="mood" value="1" required>热烈</label>

                                            <label for=""><input type="radio" name="mood" value="2" required>快乐</label>

                                            <label for=""><input type="radio" name="mood" value="3" required>温暖</label>

                                            <label for=""><input type="radio" name="mood" value="4" required>伤感</label>

                                            <label for=""><input type="radio" name="mood" value="5" required>怀旧</label>

                                            <label for=""><input type="radio" name="mood" value="6" required>励志</label>

                                            <label for=""><input type="radio" name="mood" value="7" required>另类</label>
                                        </p>
                                        <p>&nbsp;</p>
                                        <p >
                                            <button type="submit" name="submit_pass" value="submit_pass" class="ruku" onclick=passMusic("submit_pass")>入库</button>
                                        </p>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div style="text-align: center;padding:53px 0;">
                            <form style="" method="post" id="backMusic">
                                {{csrf_field()}}
                                <div class="dahui">
                                    {{--<select name="refuse">--}}
                                    {{--<option value="">内部打回理由-打回时必选</option>--}}
                                    {{--<option value="1">物料一般错误</option>--}}
                                    {{--<option value="2">物料匹配错误</option>--}}
                                    {{--<option value="3">质量太差</option>--}}
                                    {{--<option value="4">内容不适合中国地区</option>--}}
                                    {{--<option value="5">捣乱</option>--}}
                                    {{--</select>--}}
                                    <input type="hidden" name="id"/>
                                    <input type="hidden" name="album_id"/>
                                    <button type="button" name="submit_single" value="submit_single" onclick=backMusic('submit_single')>打回单曲</button>
                                    <button type="button" name="submit_albums" value="submit_albums" onclick=backMusic('submit_albums') style="margin-left:10px;">打回专辑</button>
                                </div>
                            </form>
                        </div>
                    </section>
                </div>
            </div>
            <div class="center_right">
                <!--<p>-->
                <button type="button" class="zhengzaishenhe" onclick=checking()>正在审核（{{$statistics[4]}}）</button><button type="button" class="dahuishenhe" onclick=back()>打回重审（{{$statistics[3]}}）</button>
                <!--</p>-->
                <div style="display:block;" class="img_hide">
                    <table class="checktable">
                        <thead>
                        <tr>
                            <th>表演者</th>
                            <th>音乐标题</th>
                            <th>上传时间</th>
                            {{--<th>状态</th>--}}
                        </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                    <div style="display: block;position: relative;" onclick="getTask()">
                        <img src="{{asset('images/icon/e666314919f457e68f2f161ae9086f3a.png')}}" alt="领取" >
                        <p class="qingwa">领取<span>30</span>首</p>
                    </div>
                </div>
                <div class="item">
                    <table class="backcheck">
                        <thead>
                            <tr>
                                <th>表演者</th>
                                <th>音乐性质</th>
                                <th>上传时间</th>
                            </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
<script type="text/javascript" src="//at.alicdn.com/t/font_809874_lzrjua7w53k.js"></script>
<script type="text/javascript" src="{{URL::asset('js/music/ReviewWarehousing.js')}}"></script>
<script>
 function getTask(){
     $.get('http://{{$_SERVER['HTTP_HOST']}}/admin/musicGetTask', function (data) {
         if(data[0]['id']) {
             var tr = '';
             $('.checktable tbody').html('');
             for (var i = 0; i < data.length; i++) {
                 tr += "<tr onclick=detail(" + data[i]['id'] + ") id=tr"+ data[i]['id'] +"><td>" + data[i]['performer'] + "</td><td>" + data[i]['title'] + "</td><td>" + data[i]['created_at'] + "</td>"
             }
         }else{
             tr = '<tr><td>无任务</td></tr>';
         }
         $('.checktable tbody').append(tr);
     })
 }
 function detail(id){
     $("input:radio").prop('checked',false);
     $("input:checkbox").prop('checked',false);
     $(".checktable tr").css('background','#fff');
     $(".checktable tr").css('color','black');
     $(".backcheck tr").css('background','#fff');
     $(".backcheck tr").css('color','black');
     document.getElementById("detail16").src ='';
     document.getElementById("detail17").src ='';
     document.getElementById("detail18").src ='';
     document.getElementById("detail19").src ='';
     document.getElementById("detail20").src ='';
     $.get('http://{{$_SERVER['HTTP_HOST']}}/admin/musicDetail/'+id,function(data){
         if(data[0]['id']) {
             $(".id").val(data[0]['id']);
             $(".detail1").text(data[0]['title']);
             $(".detail2").text(data[0]['performer']);
             $(".detail3").text(data[0]['writer']);
             $(".detail4").text(data[0]['composer']);
             if (data[0]['album']) {
                 $(".detail5").text(data[0]['album']);
             }else{
                 $(".detail5").text(data[0]['title']);
             }
             $(".detail6").text(data[0]['neighboring_right_1']);
             $(".detail7").text(data[0]['neighboring_right_2']);
             $(".detail8").text(data[0]['neighboring_right_3']);
             $(".detail9").attr('src',data[0]['cover']);
             if(data[0]['album']){
                 $(".detail10").text("专辑封面");
             }else{
                 $(".detail10").text("单曲封面");
             }
             $(".detail11").text(data[0]['image_info']['mime']);
             $(".detail12").text(data[0]['image_info']['0']+'*'+data[0]['image_info']['1']);
             $(".detail13").text(data[0]['image_info']['0']+'*'+data[0]['image_info']['1']);
             $(".detail14").html("<pre>"+data[0]['lyrics']+"</pre>");
             $(".detail15").text(data[0]['description']);
             document.getElementById("detail16").src = 'http://{{$_SERVER['HTTP_HOST']}}/music/'+data[0]['music_file']['remote_path'];

             if(data[0]['accompaniment_file']) {
                 document.getElementById("detail17").src = 'http://{{$_SERVER['HTTP_HOST']}}/music/'+data[0]['accompaniment_file']['remote_path'];
             }
             if(data[0]['video_file']) {
                 document.getElementById("detail18").src = 'http://{{$_SERVER['HTTP_HOST']}}/music/'+data[0]['video_file']['remote_path'];
             }
             if(data[0]['mv_file']) {
                 document.getElementById("detail19").src = 'http://{{$_SERVER['HTTP_HOST']}}/music/'+data[0]['mv_file']['remote_path'];
             }
             if(data[0]['karaoke_file']) {
                 document.getElementById("detail20").src = 'http://{{$_SERVER['HTTP_HOST']}}/music/'+data[0]['karaoke_file']['remote_path'];
             }
             $("#tr"+id).css('background','#CF2121');
             $("#tr"+id).css('color','white');
             $("input[name='id']").val(id);
             $("input[name='album_id']").val(data[0]['album_id']);
             $("input[name='music_file_uuid']").val(data[0]['music_file_uuid']);
             $("input[name='accompaniment_file_uuid']").val(data[0]['accompaniment_file_uuid']);
             $("input[name='mv_file_uuid']").val(data[0]['mv_file_uuid']);
             $("input[name='video_file_uuid']").val(data[0]['video_file_uuid']);
             $("input[name='karaoke_file_uuid']").val(data[0]['karaoke_file_uuid']);
             var jsObject = JSON.parse(data[0]['detail_refuse']);
             if(jsObject!=null) {
                 if (jsObject.title) {
                     $('.title').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.performer) {
                     $('.performer').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.writer) {
                     $('.writer').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.composer) {
                     $('.composer').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.album) {
                     $('.album').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.neighboring_right_1) {
                     $('.neighboring_right_1').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.neighboring_right_2) {
                     $('.neighboring_right_2').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.neighboring_right_3) {
                     $('.neighboring_right_3').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.image) {
                     $('.image').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.lyrics) {
                     $('.lyrics').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.description) {
                     $('.description').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.music_file) {
                     $('.music_file').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.accompaniment) {
                     $('.accompaniment').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.video) {
                     $('.video').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.mv) {
                     $('.mv').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
                 if (jsObject.karaoke) {
                     $('.karaoke').css('background-image', 'url("{{asset('images/icon/标注.png')}}")')
                 }
             }
         }
     })
 }

 function back(){
     $.get('http://{{$_SERVER['HTTP_HOST']}}/admin/reiterateMusic', function (data) {
         if(data[0]['id']) {
             var tr = '';
             $('.backcheck tbody').html(tr);
             for (var i = 0; i < data.length; i++) {
                 tr += "<tr onclick=detail(" + data[i]['id'] + ") id=tr"+ data[i]['id'] +"><td>" + data[i]['performer'] + "</td><td>" + data[i]['title'] + "</td><td>" + data[i]['created_at'] + "</td>"
             }
         }else{
             tr = '<tr><td>无任务</td></tr>';
         }
         $('.backcheck tbody').append(tr);
     })
 }

 function checking(){
     $.get('http://{{$_SERVER['HTTP_HOST']}}/admin/checkingMusic', function (data) {
         if(data[0]['id']) {
             var tr = '';
             $('.checktable tbody').html(tr);
             for (var i = 0; i < data.length; i++) {
                 tr += "<tr onclick=detail(" + data[i]['id'] + ") id=tr"+ data[i]['id'] +"><td>" + data[i]['performer'] + "</td><td>" + data[i]['title'] + "</td><td>" + data[i]['created_at'] + "</td>"
             }
         }else{
             tr = '<tr><td>无任务</td></tr>';
         }
         $('.checktable tbody').append(tr);
     })
 }

 function search(){
     $.post($("#searchform").attr('action'),
         $("#searchform").serialize(),
         function(data) {
             if(data['data'][0]['id']) {
                 var tr = '';
                 $('.checktable tbody').text(tr);
                 for (var i = 0; i < data['data'].length; i++) {
                     tr += "<tr onclick=detail(" + data['data'][i]['id'] + ") id=tr"+ data['data'][i]['id'] +"><td>" + data['data'][i]['performer'] + "</td><td>" + data['data'][i]['title'] + "</td><td>" + data['data'][i]['created_at'] + "</td>"
                 }
             }
             $('.checktable tbody').append(tr);
         });
 }
//打回单曲或专辑
 function backMusic(pars){
     $.post("{{url('admin/checkMusic')}}",
         $("#backMusic").serialize()+"&"+pars+"="+pars,
         function(data) {
             if(typeof(data.id) == 'string'){
                 $("#tr" + data.id).remove();
             }else{
                 for (i=0;i<data.id.length ;i++ )
                 {
                     $("#tr" + data.id[i].id).remove();
                 }
             }
         });
 }
//审核通过
 function passMusic(pars){
     $('#passMusic').validate({
         submitHandler : function (form) {
             var data = $("input[name='id']").val();
             if(!data){
                 layer.msg('请选择审核的歌曲');
             }
             $.post("{{url('admin/checkMusic')}}",
                 $("#passMusic").serialize()+"&"+pars+"="+pars,
                 function(data) {
                     $("#tr" + data.id).remove();
                     $("input[name='id']").val("");
             });
         }
     });
 }
 //音乐弹窗
function updateDetail(pars) {
    var id = $('.id').val();
    layer.open({
        type: 2,
        area: ['600px', '400px'],
        //anim: 4,
        content: 'http://{{$_SERVER['HTTP_HOST']}}/admin/amend/'+pars+'/'+id,
        end: function(){
            detail(id)
        }
    });
}
function signDetail(pars){
     var id = $('.id').val();
     layer.open({
         type: 2,
         area:['600px','300px'],
         //anim:4,
         content: 'http://{{$_SERVER['HTTP_HOST']}}/admin/sign/'+pars+'/'+id,
     });
}

function bigLay(pars){
    var id = $('.id').val();
    layer.open({
        type: 2,
        area:['600px','600px'],
        content: 'http://{{$_SERVER['HTTP_HOST']}}/admin/bigLay/'+pars+'/'+id,
    });
}
</script>
@endsection
